<script setup lang="ts">
withDefaults(defineProps<{ showCenter: boolean; content: string }>(), {
   showCenter: false
})

defineEmits(['update:content', 'create', 'closePopup'])
</script>

<template>
   <div>
      <van-popup @click-overlay="$emit('closePopup')" v-bind:show="showCenter" round :style="{ padding: '40px' }">
         <van-cell-group inset>
            <van-field @input="$emit('update:content', $event.target.value)" rows="1" autosize type="textarea"
               placeholder="输入评论...." />
         </van-cell-group>
         <van-button round block type="primary" native-type="submit" @click="$emit('create')"> 发表 </van-button>
      </van-popup>
   </div>
</template>
